<%- model_class = User -%>
<div class="page-header">
  <h1><%=t '.title', :default => model_class.model_name.human.titleize %></h1>
</div>

<% if @user.avatar.present? %>

    <div class="asset">
      <p>
        <%= image_tag(@user.avatar.url, size: "100x100", alt: "Edit Entry") %>
      </p>
      <p><small><%= number_to_human_size(@user.avatar.size) %>
      </small></p>
    </div>
<% end %>

<dl class="dl-horizontal">
  <dt><strong><%= model_class.human_attribute_name(:name) %>:</strong></dt>
  <dd><%= @user.name %></dd>
</dl>

<dl class="dl-horizontal">
  <dt><strong><%= model_class.human_attribute_name(:mobile) %>:</strong></dt>
  <dd><%= @user.mobile %></dd>
</dl>

<dl class="dl-horizontal">
  <dt><strong>权限:</strong></dt>
  <% @user.roles.each do |role| %>
      <dd><%= t(role.name) %></dd>
  <% end %>
</dl>


<%= link_to t('.edit', :default => t("helpers.links.edit")),
            '',
            "data-href" =>edit_admin_user_path(@user),
            :class => 'btn btn-primary' %>
<%= link_to t('.back', :default => t("helpers.links.back")),
            '',
            "data-href" => admin_users_path,
            :class => 'btn btn-primary'  %>
<!--
<% if policy(@user).isAdmin? %>
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
            admin_user_path(@user),
            :method => 'delete',
            :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
            :class => 'btn btn-danger' %>
<% end %>
-->